﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Calendar1="clr-namespace:KJFramework.UI.Calendar"
	mc:Ignorable="d"
	x:Class="KJFramework.UI.Calendar.DateButton"
	x:Name="UserControl" Width="Auto">

	<UserControl.Resources>        
		<Calendar1:DateTimeConverter x:Key="dateTimeConverter"/>
		<Storyboard x:Key="OnMouseEnter1">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0.7"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="#E5E8F6FE"/>
				<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#E5E8F6FE"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="#E5C7E9FB"/>
				<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#E5C7E9FB"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="OnMouseLeave1">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.7"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="sc#0.9, 0.806952238, 0.921581864, 0.9911021"/>
				<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#E5E8F6FE"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFace" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="sc#0.9, 0.571124852, 0.8148466, 0.9646863"/>
				<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#E5C7E9FB"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="Mouse.MouseEnter">
			<BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}" x:Name="OnMouseEnter1_BeginStoryboard"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave">
			<BeginStoryboard Storyboard="{StaticResource OnMouseLeave1}" x:Name="OnMouseLeave1_BeginStoryboard"/>
		</EventTrigger>        
	</UserControl.Triggers>

	<Grid x:Name="LayoutRoot">
		<Rectangle x:Name="ButtonFace" Height="Auto" Stroke="#FFA5E7F6" RadiusX="4" RadiusY="4" Margin="1,1,1,1" StrokeThickness="1" Opacity="0">
			<Rectangle.Fill>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#E5E8F6FE" Offset="0"/>
					<GradientStop Color="#E5C7E9FB" Offset="1"/>
				</LinearGradientBrush>
			</Rectangle.Fill>
		</Rectangle>
		<Rectangle x:Name="ButtonSelectedFace" Height="Auto" Stroke="#FFA5E7F6" RadiusX="4" RadiusY="4" Margin="1,1,1,1" StrokeThickness="1" Opacity="0">
			<Rectangle.Fill>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#E5E8F6FE" Offset="0"/>
					<GradientStop Color="#E5C7E9FB" Offset="1"/>
				</LinearGradientBrush>
			</Rectangle.Fill>
		</Rectangle>
		<Label x:Name="TextLabel" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Content="{Binding Path=Date, Converter={StaticResource dateTimeConverter}, ElementName=UserControl, Mode=OneWay}" Margin="0,0,2,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
		<Border HorizontalAlignment="Stretch" x:Name="ButtonBorder" VerticalAlignment="Stretch" Width="Auto" BorderBrush="#FF3998E1" BorderThickness="1.5,1.5,1.5,1.5" CornerRadius="4,4,4,4" Visibility="Visible" Margin="1,1,1,1"/>
	</Grid>
</UserControl>